package org.jaaksi.kottlindemo.test

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import libcore.kotpref.AppSp
import org.jaaksi.kottlindemo.databinding.ActivityTestFlowBinding
import org.jaaksi.kottlindemo.leak.BannerAd
import org.jaaksi.kottlindemo.model.Person
import org.jetbrains.anko.toast

class TestActivity : AppCompatActivity() {
    private val binding by lazy { ActivityTestFlowBinding.inflate(layoutInflater) }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
        println(">> $this")
        BannerAd.loadAd(binding.btn)
        binding.btn.setOnClickListener {
            toast("age = ${AppSp.age}")
        }

        binding.btn2.setOnClickListener {
//            AppSp.age = 10
            finish()
        }
        finish()
    }

}